<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>快递助手</title>
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
    <style type="text/css">
        body
        {
            background-image: url('/bootstrap/img/bj.jpg');
        }
    </style>
</head>
<body>
<div>
    <div style="padding: 100px 100px 10px;" class="center-block">
        <form class="bs-example bs-example-form" role="form">
            <div class="row">
                <div class="col-lg-3"></div>
                <div class="center-block col-lg-6" style="margin-top: 30px";>
                    <div class="input-group">
                        <input type="text" placeholser="请输入快递单号" class="form-control" id="number" name="number" maxlength="100">
                        <span class="input-group-btn">
                            <button class="btn btn-default" id="btn_geturl" type="button">
                                查询
                            </button>
                        </span>
                    </div><!-- /input-group -->
                </div><!-- /.col-lg-6 -->
            </div><!-- /.row -->
        </form>
    </div>
    <div style="margin-top: 50px;">
            <div class="panel-body" id="packDetails">
                <span id="packDetails1"></span>
            </div>
    </div>
</div>
<script src="bootstrap/js/jquery.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>
<script>
    $(function () {
        // 回车事件
        $('#number').keypress(function (event) {
            if (13 == event.keyCode) {
                getPackDetails();
              return false;
            }
        });
        $("#btn_geturl").click(function () {
            getPackDetails();
        })
    });

    function getPackDetails() {
        var number=$("#number").val();
        $.ajax(
            {
                url:"getPackDetails",
                type:"POST",
                data:{
                    number:number
                },
                success: function (data) {
                    $.each(data,function(index,val) {
                        alert(val.acceptTime);
                        alert(val.acceptStation);
                    });
                },
                error: function (jqXHR, textStatus, errorThrown) {
                    /*错误信息处理*/
                }
            }
        )
    }
</script>
</body>
</html>